function map($field, $value, $fieldinfo){
	eval("\$setting = $fieldinfo[setting];");
	extract($setting);
	if($value){
		$value=explode("|",$value);
		$mapx=$value[0];
        $mapy=$value[1];
		$xyz = 'new BMap.Point('.$mapx.','.$mapy.')';
        if($mapclass==1)$mapz=$value[2];
	}
	$data="<input type='text' size='20' name='info[".$field."][mapx]' id='".$field."mapx' value='".$mapx."' />&nbsp;&nbsp;&nbsp;<input type='text' size='20' name='info[".$field."][mapy]' id='".$field."mapy' value='".$mapy."'/>";
	if(!$value || $xyz == "new BMap.Point(,)"){
		$xyz = '"广州"';
	}
	if ($mapclass==1){
		$mapjs = <<< herf
		<script language="javascript" src="http://api.51ditu.com/js/maps.js"></script>
        <script language="javascript" src="http://api.51ditu.com/js/ezmarker.js"></script>
		<script language="JavaScript">
		<!--
        //setMap是ezmarker内部定义的接口，这里可以根据实际需要实现该接口
        function setMap(point,zoom){
			document.getElementById("{$field}mapx").value=point.getLongitude();
			document.getElementById("{$field}mapy").value=point.getLatitude();
            document.getElementById("{$field}mapz").value=zoom;
        }
        var ezmarker = new LTEZMarker("{$field}");	
		//var c = "huzhou";
		//ezmarker.setDefaultView(c,3);
		ezmarker.setValue(new LTPoint({$mapx},{$mapy}),{$mapz});
        LTEvent.addListener(ezmarker,"mark",setMap);//"mark"是标注事件
        //-->
        </script>
herf;
		
		$data .="&nbsp;&nbsp;&nbsp;<input type='text' size='20' name='info[".$field."][mapz]' id='".$field."mapz' value='".$mapz."'/>".$mapjs;
		
	}else if($mapclass==2){
		$mapjs = <<< herf
			<div id="{$field}mapbaidu" style="z-index:1000;position:absolute; right:100px;width: 505px; height: 400px; background-color:#F2EFE9; text-align:center;display:none;">
				<div id='{$field}mark_mymapbaidu' style='width: 505px; height: 350px;' >
			</div>
            <br/>
            <input type="button" class="button" value="关闭地图窗口" onClick="$('#{$field}mapbaidu').hide();" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>提示:右键可(添加/移动标注地点)</span>
            </div>

			 <script src="http://api.map.baidu.com/api?v=1.4" type="text/javascript"></script>
			 <script type="text/javascript">

				</script>
		   <script type="text/javascript" language="javascript">
		   function atmark_{$field}() { //标注接口开始
				var map = new BMap.Map("{$field}mark_mymapbaidu");            // 创建Map实例
				
				map.centerAndZoom({$xyz},12);  //初始化时，即可设置中心点和地图缩放级别。
				
				var address = document.getElementById("address").value;
			
				
				if(address){
					var myGeo = new BMap.Geocoder();
					myGeo.getPoint(address, function(point){
					  if (point) {
						map.centerAndZoom(point, 16);
						
						var markerone = new BMap.Marker(point), px = map.pointToPixel(point);
						map.addOverlay(markerone);
						markerone.enableDragging();
						var p = markerone.getPosition();       //获取markerone的位置
						setLatLng_{$field}(p.lat,p.lng);

						markerone.addEventListener("dragend", function(){
							var p = markerone.getPosition();       //获取markerone的位置
							setLatLng_{$field}(p.lat,p.lng);
						});
						markerone.addEventListener("rightclick", function(){
							markerone.hide();  
						});
					  }
					}, "广州市");
					
				}
				
				
				map.enableScrollWheelZoom();    //启用滚轮放大缩小，默认禁用
				map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
				var contextMenu = new BMap.ContextMenu();
				var txtMenuItem = [
				  {
				   text:'放大',
				   callback:function(){map.zoomIn()}
				  },
				  {
				   text:'缩小',
				   callback:function(){map.zoomOut()}
				  },
				  {
				   text:'放置到最大级',
				   callback:function(){map.setZoom(18)}
				  },
				  {
				   text:'查看全国',
				   callback:function(){map.setZoom(4)}
				  },
				  {
				   text:'在此添加标注',
				   callback:function(p){
					var marker = new BMap.Marker(p), px = map.pointToPixel(p);
					map.addOverlay(marker);
					marker.enableDragging();
					var p = marker.getPosition();       //获取marker的位置
					setLatLng_{$field}(p.lat,p.lng);

					marker.addEventListener("dragend", function(){
						var p = marker.getPosition();       //获取marker的位置
						setLatLng_{$field}(p.lat,p.lng);
					});
					marker.addEventListener("rightclick", function(){
						marker.hide();  
					});
					
				   }
				  }
				 ];


				 for(var i=0; i < txtMenuItem.length; i++){
				  contextMenu.addItem(new BMap.MenuItem(txtMenuItem[i].text,txtMenuItem[i].callback,100));
				  if(i==1 || i==3) {
				   contextMenu.addSeparator();
				  }
				 }
				 map.addContextMenu(contextMenu);
				
			}
			function setLatLng_{$field}(lat,lng) {
				document.getElementById("{$field}mapx").value=lat;
				document.getElementById("{$field}mapy").value=lng; 
			}
			</script>
			<a onclick="$('#{$field}mapbaidu').show();atmark_{$field}();" /><img src="/statics/images/button-f.gif"></a>
herf;
	$data .=$mapjs;
	}else{
		$mapjs = <<< herf
			
			<div id="{$field}mapdiv" style="position:absolute; right:100px;width: 505px; height: 400px; background-color:#F2EFE9; text-align:center;display:none;"><div id='{$field}mark_mymap' style='width: 505px; height: 350px;' ></div>
            <br/>
            <input type="button" value="关闭地图窗口" onClick="$('#{$field}mapdiv').hide();" />
            </div>

			<script src="http://maps.google.com/maps?file=api&v=2&key={$mapz}" type="text/javascript" charset="utf-8"></script>
		   <script type="text/javascript" language="javascript">
		   function atmark_{$field}() { //标注接口开始
				var map = null;
				if (GBrowserIsCompatible()) { //判断是否生成
					var map = new GMap2(document.getElementById('{$field}mark_mymap'));
					map.setCenter(new GLatLng({$mapx},{$mapy}), 14);
					map.addControl(new GSmallMapControl()); //是否显示缩放
					map.addControl(new GMapTypeControl()); //是否显示卫星地图
				}
				map.clearOverlays(marker);   //清除地图上的标记点，否则会显示多个                        
				var Center = map.getCenter();
				var lat = new String(Center.lat());
				var lng = new String(Center.lng());
				setLatLng_{$field}(lat, lng);
				var marker = new GMarker(new GLatLng(lat, lng), {draggable: true});
				GEvent.addListener(marker, "dragend", function() {
				var latlng = marker.getLatLng();
				lat = String(latlng.lat());
				lng = String(latlng.lng());
				setLatLng_{$field}(lat, lng);
			});
			map.addOverlay(marker); // 写入标记到地图上
			}
			function setLatLng_{$field}(lat,lng) {
				document.getElementById("{$field}mapx").value=lat;
				document.getElementById("{$field}mapy").value=lng; 
			}
			</script>
			<a onclick="$('#{$field}mapdiv').show();atmark_{$field}();" /><img src="/statics/images/button-f.gif"></a>
		               
herf;
		   $data .=$mapjs;
		
		}
		return $data;

}